package org.yefei.homeworkday15.three;

public class Airliner extends AirPlane {
	// 客机类
	private int seating;// 座位数

	public Airliner(double weight, double height, String type, int seating) {
		super(weight, height, type);
		this.seating = seating;
	}

	public int getSeating() {
		return seating;
	}

	public void setSeating(int seating) {
		if (seating <= 0) {
			System.err.println("座位数不合理！");
			seating = 2000;
		}
		this.seating = seating;
	}

	// 接送旅客方法
	public void pickUp() {
		System.out.println(super.getType() + "可以接送旅客！");
	}

	@Override
	public void takeOf() {
		System.out.println("重量为" + super.getWeight() + "吨的" + seating + "座的" + super.getType() + "滑行100米，起飞！");
	}

	@Override
	public void accelerate() {
		System.out.println(super.getType() + "缓缓加速！飞行到" + super.getHeight() + "米的高空");
	}

	@Override
	public void landing() {
		System.out.println(super.getType() + "缓缓下降！");
	}

}
